<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\project\Project;

/* @var $this yii\web\View */
/* @var $model common\models\projectsummary\ProjectSummary */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', '项目总结报告'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="project-summary-view">

    <p>
        <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('app', '查看项目'), ['project/view', 'id' => $model->pr_id], ['class' => 'btn btn-primary']) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'number',
            'name',
            'cname',

            [
                'attribute' => 'category',
                'value' => Project::getArrayCategory()[$model->category],
            ],
            
            'bearunit',
            'amount_subsidy',
            [
                'attribute' => 'starttime',
                'format' => ['date', 'Y-M-d H:i'],
            ],
            [
                'attribute' => 'endtime',
                'format' => ['date', 'Y-M-d H:i'],
            ],

            'proj_leader',
            'proj_telephone',

            [
                'attribute' => 'proj_summ',
                'format' => 'raw',
            ],

            [
                'attribute' => 'registration_form',
                'format' => 'raw',
            ],
            
            [
                'attribute' => 'bear_option',
                'format' => 'raw',
            ],
            
            [
                'attribute' => 'mana_option',
                'format' => 'raw',
            ],
            
            'depart_leader',
            'total_appropriation',
            'surplus',
        ],
     ]) ?>
            
    <table class="table table-striped table-bordered detail-view">
        <thead>
            <th>序号</th>
            <th>内容</th>
            <th>金额</th>
            <th>备注</th>
        </thead>
        <tbody>
            <?php if(!empty($model->actual_item)) { ?>
            <?php foreach ($model->actual_item as $k=>$vo) { ?>
            <tr>
                <td><?= $k+1 ?></td>
                <td><?= $vo ?></td>
                <td><?= $model->paid_money[$k] ?></td>
                <td><?= $model->paid_note[$k] ?></td>
            </tr>
            <?php } ?>
            <?php } ?>
        </tbody>
    </table>
        
            
    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'fina_leader',
            'lister',
            'file_name',
            'file_description',
            'proj_size',
        ],
    ]) ?>

</div>
